<?php 
include '../config.php';
if(!empty($_POST)){
	$p = $_POST;
	$nome = $p['nome'];
	$email = $p['email'];
	$senha = md5($p['senha']);
	$tipo = "1";
	
	$query = "INSERT INTO usuarios (id, nome, email, senha, tipo) VALUES (null, '$nome', '$email', '$senha', '$tipo')";
    $ret = mysql_query($query,$conn) or die(mysql_error());
}else{
	echo "Usuário não cadastrado.";
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>SGE | Cadastro de Usuário</title>
	<style type="text/css">@import url('../css/bootstrap.css');</style>
</head>
<body>
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<div class="row clearfix">
				<div class="col-md-3 column">
				</div>
				<div class="col-md-6 column">
					<h2 class="text-center">
								<img src="../img/ifsertao.jpg" align="center"></br>
								</br>Cadastrando Usuário
							</h2><br><br>
					<div class="col-md-3 column">
					</div>
					<div class="col-md-6 column">
						<form role="form" action="criando_usuario.php" method="post" target="_self">
						<div class="form-group">
							 <label for="exampleInputEmail1">Nome:</label><input type="text" class="form-control" id="nome" name="nome" value="" />
						</div>
						<div class="form-group">
							 <label for="exampleInputEmail1">Email:</label><input type="email" class="form-control" id="email" name="email" value="" />
						</div>
						<div class="form-group">
							 <label for="exampleInputPassword1">Senha:</label><input type="password" class="form-control" id="senha" name="senha" value="" />
						</div>
						<div class="">
						</div> <button type="submit" id="acao" name="acao" value="logar" class="btn btn-primary">Cadastrar</button>
					</form>
					</div>
					<div class="col-md-3 column">
					</div>
	<!--<script src="http://code.jquery.com/jquery-latest.min.js"></script>-->
	<script src="../js/bootstrap.js"></script>
</body>
</html>